Skip to content

feat(ci): publish linux/amd64 and linux/arm64 images - #137

Merged
Jumziey merged 1 commit into
mainfrom
worktree-arm64-images
Nov 21, 2026
Merged

Jumziey merged 1 commit into
mainfrom
worktree-arm64-images

Conversation

@Jumziey

@Jumziey Jumziey commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Closes #132

Summary

Both images publish linux/amd64 + linux/arm64 as one manifest list per tag, on all channels. native-image cannot cross-compile, so each backend binary is compiled on a runner of its own architecture (new ADR 0043, docs/adr/0043-images-are-multi-arch-built-natively-per-architecture.md).

 build-images.yml (called by edge.yml and release.yml)
   identity
-  backend             ubuntu-latest, amd64      -> pushes tags
+  backend (amd64)     ubuntu-24.04              -> pushes by digest, no tag
+  backend (arm64)     ubuntu-24.04-arm          -> pushes by digest, no tag
+  backend-manifest    needs both architectures  -> writes tags as one manifest list
-  frontend            amd64                     -> pushes tags
+  frontend            amd64 + arm64, no QEMU    -> pushes tags as one manifest list

 pr.yml
   fast
+    ci/test-native-dockerfile-arch.sh
-  native
+  native (amd64)
+  native (arm64)
   manifests

Dockerfile.native-ci selects the ELF loader from the target architecture:

-patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2
+case "$TARGETARCH" in
+  amd64) loader=/lib64/ld-linux-x86-64.so.2 ;;
+  arm64) loader=/lib/ld-linux-aarch64.so.1 ;;
+  *)     fail "unsupported target architecture" ;;
+esac
+patchelf --set-interpreter "$loader"

A backend tag moves only when both architectures are built. The publish workflow checks the platforms of each tag after it writes the tag.

Evidence

  • Before: bash ci/test-native-dockerfile-arch.sh against the old Dockerfile
    PASS: linux/amd64 uses /lib64/ld-linux-x86-64.so.2 and has no RPATH
    ERROR: process "/bin/sh -c apk add --no-cache patchelf" did not complete successfully: exit code: 255
    
    After:
    PASS: linux/amd64 uses /lib64/ld-linux-x86-64.so.2 and has no RPATH
    PASS: linux/arm64 uses /lib/ld-linux-aarch64.so.1 and has no RPATH
    PASS: linux/ppc64le rejected as an unsupported target architecture
    
  • Before: the published image, bash ci/check-image-platforms.sh linux/amd64,linux/arm64 ghcr.io/sreyardship/platformup2date/backend:edge
    FAIL: ghcr.io/sreyardship/platformup2date/backend:edge lacks linux/arm64; it publishes:
    linux/amd64
    unknown/unknown
    
    After: not available before merge. See "Not verified".
  • frontend/ci/bin/test-build-version-image.sh passes with the changed frontend/Dockerfile.
  • docker build --platform linux/arm64 frontend completes on an amd64 host without emulation and gives a linux/arm64 image.
  • /lib/ld-linux-aarch64.so.1 and /usr/lib64/libz.so.1 exist in the arm64 UBI9 images that the Dockerfile uses.
  • actionlint and shellcheck pass.

Not verified

  • arm64 native build and integration tests. They were not run locally. The native (arm64) check on this PR is the first run.
  • The publish workflow. It runs only on main and on tags. The digest hand-over between the jobs and docker buildx imagetools create are checked by reading and by actionlint only.

Post-merge check, after the edge run on main:

bash ci/check-image-platforms.sh linux/amd64,linux/arm64 \
  ghcr.io/sreyardship/platformup2date/backend:edge \
  ghcr.io/sreyardship/platformup2date/frontend:edge

The publish workflow runs the same check on each tag it writes.

Merge Danger

Door: two-way

A revert restores amd64-only publishing. It becomes a commitment after the first release that arm64 users pull.

Blast Radius: publishing

  • If the new backend jobs fail on main, no backend tag moves and :edge stays on the last good image. The frontend job is independent and can still move its tags, as before.
  • Do not tag v1.0.0 before one edge run publishes both architectures.
  • The check native is replaced by native (amd64) and native (arm64). main has no branch protection now. If required checks are added, use the new names.
  • Each PR and each publish now needs a GitHub-hosted arm64 runner.
  • The backend publish jobs and the PR native jobs are pinned to ubuntu-24.04 / ubuntu-24.04-arm instead of ubuntu-latest, so both architectures compile against the same glibc.

The published images were linux/amd64 only. Both images now publish one
manifest list per tag for linux/amd64 and linux/arm64, on all channels.

- Backend: native-image cannot cross-compile, so each binary is compiled
  on a runner of its own architecture and pushed by digest. One last job
  joins the digests into the manifest list and writes the tags, so a tag
  moves only when both architectures are built.
- Dockerfile.native-ci selects the ELF loader from the target
  architecture and fails the build for other architectures.
- Frontend: one multi-platform build. The build stage runs on the build
  platform and the runtime stage has no RUN step, so no emulation is used.
- PR checks run the native integration tests on arm64 also, on the same
  pinned runner images that publishing uses.
- The publish workflow verifies the platforms of each tag it writes.

Refs #132
@Jumziey
Jumziey merged commit f971b42 into main Nov 21, 2026
4 checks passed
@Jumziey
Jumziey deleted the worktree-arm64-images branch November 21, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish arm64 container images

1 participant